#!/bin/bash

echo "4g EC20 pwr enable"

/home/samba/share/cm4_ec20_power_ctrl/cm4_ec20pwrctrl 1

echo "search ttyUSB3..."

Nousb3=0

res=$(ls /dev | grep ttyUSB3)


while($res)
do
	sleep 1s
	
	res=$(ls /dev | grep ttyUSB3)

	echo	"search ttyUSB3..."
done


echo "search ttyUSB3 done"

echo "start ppp ttyUSB3 CMNET..."

sudo /home/samba/share/dky_mqtt/mqttGW/linux-ppp-scripts/quectel-pppd.sh /dev/ttyUSB3 CMNET
#sudo /home/pi/linux-ppp-scripts/quectel-pppd.sh /dev/ttyUSB3 CMIOTSCDL.SC

echo "del default dev eth0..."
sudo route del default dev eth0

echo "add default dev ppp0"
sudo route add default dev ppp0




